Optimal. Leaf size=35 \[ \frac{(a B+A b) \tanh ^{-1}(\sin (c+d x))}{d}+\frac{a A \tan (c+d x)}{d}+b B x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.113709, antiderivative size = 35, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.138, Rules used = {2968, 3021, 2735, 3770} \[ \frac{(a B+A b) \tanh ^{-1}(\sin (c+d x))}{d}+\frac{a A \tan (c+d x)}{d}+b B x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2968
Rule 3021
Rule 2735
Rule 3770
Rubi steps
\begin{align*} \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx &=\int \left (a A+(A b+a B) \cos (c+d x)+b B \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx\\ &=\frac{a A \tan (c+d x)}{d}+\int (A b+a B+b B \cos (c+d x)) \sec (c+d x) \, dx\\ &=b B x+\frac{a A \tan (c+d x)}{d}-(-A b-a B) \int \sec (c+d x) \, dx\\ &=b B x+\frac{(A b+a B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac{a A \tan (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.0139163, size = 43, normalized size = 1.23 \[ \frac{a A \tan (c+d x)}{d}+\frac{a B \tanh ^{-1}(\sin (c+d x))}{d}+\frac{A b \tanh ^{-1}(\sin (c+d x))}{d}+b B x \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.07, size = 65, normalized size = 1.9 \begin{align*} bBx+{\frac{A\tan \left ( dx+c \right ) a}{d}}+{\frac{Ab\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{aB\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{Bbc}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.10044, size = 99, normalized size = 2.83 \begin{align*} \frac{2 \,{\left (d x + c\right )} B b + B a{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + A b{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a \tan \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.50891, size = 225, normalized size = 6.43 \begin{align*} \frac{2 \, B b d x \cos \left (d x + c\right ) +{\left (B a + A b\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) -{\left (B a + A b\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, A a \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (A + B \cos{\left (c + d x \right )}\right ) \left (a + b \cos{\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.28301, size = 113, normalized size = 3.23 \begin{align*} \frac{{\left (d x + c\right )} B b +{\left (B a + A b\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) -{\left (B a + A b\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - \frac{2 \, A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]